'''DEPRECATED. Use nevow.flat.registerFlattener instead of registering
an ISerializable adapter.
'''
def serialize(context):
'''Serialize the adaptee, with the given context
stack if necessary.
'''
pass
class IStatusMessage(Interface):
"""A marker interface, which should be set on the user's web session
to an object which can be cast to a string, which will be shown to the
user to indicate the status of the most recent operation.
"""
pass
class IHand(Interface):
'''A marker interface which indicates what object the user is currently
holding in their hand. This is conceptually the "result" of the last operation;
this interface can be used to mark a status string which indicates whether
the most recent operation completed successfully, or can be used to hold
an object which resulted from the most recent operation.
'''
pass
class ICanHandleException(Interface):
def renderHTTP_exception(context, failure):
'''Render an exception to the given request object.
'''
pass
def renderInlineException(context, reason):
'''Return stan representing the exception, to be printed in the page,
not replacing the page.'''
pass
class ICanHandleNotFound(Interface):
def renderHTTP_notFound(context):
'''Render a not found message to the given request.
'''
pass
class IEventMaster(Interface):
pass
class IDocFactory(Interface):
"""Interface for objects that load and parse templates for Nevow's
renderers.
The load method's context arg is optional. Loaders should be written to cope
with no context arg and either create a new context (if necessary) or raise
a ValueError if the context of the caller is important.
If a context is passed to load() it should *not* be passed on to the
flattener/precompiler; a new context should be created if necessary. This
measure is to ensure that nothing remembered in the caller's context, i.e.
personal information in the session, leaks into the template until it is
actually rendered.
"""
def load(ctx = None, preprocessors = ()):
'''
Load a template and return a stan document tree.
@param preprocessors: An iterable of one-argument callables which will
be given the stan document tree to transform before it is compiled.
'''
pass
class ISession(Interface):
"""A web session
You can locate a Session object to represent a unique web session using
ctx.locate(ISession). This default session implementation uses cookies to
store a session identifier in the user's browser.
TODO: Need better docs; what's a session and why and how do you use it
"""
pass
class IRemainingSegments(Interface):
'''During the URL traversal process, requesting this from the context
will result in a tuple of the segments remaining to be processed.
Equivalent to request.postpath in twisted.web
'''
pass
class ICurrentSegments(Interface):
'''Requesting this from the context will result in a tuple of path segments
which have been consumed to reach the current Page instance during
the URL traversal process.
Equivalent to request.prepath in twisted.web
'''
pass
class IViewParameters(Interface):
'''An interface used by url.viewhere. When this interface is remembered
above a url.viewhere embedded in a page, and the url to the current page
is rendered, this object will be consulted for additional manipulations
to perform on the url object before returning it.
'''
def __iter__():
"""Return an iterator which yields a series of (command, args, kw) triples,
where 'command' is a string, indicating which url method to call, 'args' is a
list indicating the arguments to be passed to this method, and 'kw' is a dict
of keyword arguments to pass to this method.
"""
pass
class II18NConfig(Interface):
'''
Interface for I18N configuration.
@ivar domain: the gettext domain
@type domain: str
@ivar localeDir: path to the messages files or None to use the
system default
@type localeDir: str or None
'''
domain = Attribute('The gettext domain')
localeDir = Attribute('Path to the messages files or None to use the system default')
class ILanguages(Interface):
'''
Marker interface for the sequence of strings that defines the
languages requested by the user.
'''
pass
class ILogger(Interface):
'''
An access.log writing interface.
Remember this interface in the context stack to use alternative
logging for the resources below that point in the tree.
'''
def log(ctx):
'''Write a log entry for this request.'''
pass
class IJavascriptPackage(Interface):
'''
Represents information about the filesystem layout of a set of
JavaScript modules.
@ivar mapping: A C{dict} mapping C{str} to C{str}. The keys in
this dictionary are JavaScript module names which can be imported by
JavaScript files server by C{nevow.athena.LivePage}. The values give
locations in the filesystem where the implementation of each module can
be found.
'''
pass
class IAthenaTransportable(Interface):
'''
An object which can be sent by Athena from the Python server to the
JavaScript client.
'''
jsClass = Attribute('\n A C{unicode} string giving the fully-qualified name of a JavaScript\n function which will be invoked to unserialize the serialized form of\n this object.\n\n The current serialization implementation is limited to supporting\n values for this attribute which refer to JavaScript functions which\n are defined in modules which have already been imported by the\n client receiving the serialized data. An attempt to lift this\n limitation will likely be made at some future point.\n ')
def getInitialArguments():
'''
Define the arguments which will be passed to L{jsClass}.
@rtype: L{tuple}
@return: A tuple of simple types which will be passed as positional